package com.sinosoft.configServer;

/**
 * @author loujiang
 * @date 2020/12/26 2:22 上午
 * @NOTE:
 */
import java.util.LinkedHashMap;
import java.util.Map;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties("spring.cloud.config.server")
public class ConfigServerProperties {
    private boolean bootstrap;
    private String prefix;
    private String defaultLabel;
    private Map<String, String> overrides = new LinkedHashMap();
    private boolean stripDocumentFromYaml = true;
    private boolean acceptEmpty = true;
    private String defaultApplicationName = "application";
    private String defaultProfile = "default";
    private ConfigServerProperties.Encrypt encrypt = new ConfigServerProperties.Encrypt();

    public ConfigServerProperties() {
    }

    public ConfigServerProperties.Encrypt getEncrypt() {
        return this.encrypt;
    }

    public String getDefaultLabel() {
        return this.defaultLabel;
    }

    public void setDefaultLabel(String defaultLabel) {
        this.defaultLabel = defaultLabel;
    }

    public boolean isBootstrap() {
        return this.bootstrap;
    }

    public void setBootstrap(boolean bootstrap) {
        this.bootstrap = bootstrap;
    }

    public String getPrefix() {
        return this.prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public Map<String, String> getOverrides() {
        return this.overrides;
    }

    public void setOverrides(Map<String, String> overrides) {
        this.overrides = overrides;
    }

    public boolean isStripDocumentFromYaml() {
        return this.stripDocumentFromYaml;
    }

    public void setStripDocumentFromYaml(boolean stripDocumentFromYaml) {
        this.stripDocumentFromYaml = stripDocumentFromYaml;
    }

    public boolean isAcceptEmpty() {
        return this.acceptEmpty;
    }

    public void setAcceptEmpty(boolean acceptEmpty) {
        this.acceptEmpty = acceptEmpty;
    }

    public String getDefaultApplicationName() {
        return this.defaultApplicationName;
    }

    public void setDefaultApplicationName(String defaultApplicationName) {
        this.defaultApplicationName = defaultApplicationName;
    }

    public String getDefaultProfile() {
        return this.defaultProfile;
    }

    public void setDefaultProfile(String defaultProfile) {
        this.defaultProfile = defaultProfile;
    }

    public static class Encrypt {
        private boolean enabled = true;

        public Encrypt() {
        }

        public boolean isEnabled() {
            return this.enabled;
        }

        public void setEnabled(boolean enabled) {
            this.enabled = enabled;
        }
    }
}
